<include file="Public/siteTopbar" />
<script src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/pc_common.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>

<link rel="stylesheet" type="text/css" href="__STATIC__/css/onestepcheckout.css" media="all" />
<include file="Public/header" />

<div class="container ">
	<div class="orderLine clearfix">
		<div class="col-xs-6 ">1.<b>Your Cart</b></div>
		<div class="col-xs-6 onhover">2.<b>Pay &amp; Submit</b></div>
	</div>
</div>

<form name="cart2_form" id="cart2_form" method="post">
<div class="container" style="padding-top:50px;">

    
    
    <if condition="$_SESSION['user']['user_id'] eq ''">
     <div class="container">Already have an account? <a id="onestepcheckout-login-link" href="{:U('Home/User/login')}" >SIGN IN</a></div>
    </if>
    
<hr>





    	<div class="col-md-6">
        	<div id="billing_address_g">

                <ul class="checkoutAddr">
                    <li class="address-title">
                            Shipping address                   </li>
                     <li>
                       <label>  &ensp;</label>
                    </li>
                    
                    <if condition="($_SESSION['user']['user_id'] neq '') and ($address_list)">
                    <li>
                        <label   style="font-weight:normal;">Select a billing address from your address book or enter a new address.</label>
                        <div class="input-box">
                            <select name="g_address_id" id="g_address_id"  class="address-select" title="" >
                              <volist name="address_list" id="v" >
                                 <option value="{$v.address_id}">{$v.country}{$v.city}{$v.address} {$v.consignee} (mobile{$v.mobile})</option>
                             </volist>
                            <option value="">New Address</option></select>
                        </div>
                    </li>
                    </if>
               <li>
               
                 <ul id="billing_address_list" <if condition="($_SESSION['user']['user_id'] neq '') and ($address_list)">style="display:none;"</if>>





            <div id="address_div1">
                <li class="clearfix">
                <div class="input-box input-firstname">
                    <label >First Name<span class="required">*</span></label><br>
                    <input class="required-entry input-text" type="text" name="g_address[consignee]" id="g_consignee" value="{$user.nickname}">
                </div>
                <div class="input-box input-lastname">
                    <label  >Last Name <span class="required">*</span></label><br>
                    <input class="required-entry input-text" type="text" name="g_address[lastname]" id="g_lastname" value="{$user.lastname}">
                </div>
                </li>
               <li class="clearfix">
                   <div class="input-box input-email">
                       <label  >Email Address <span class="required">*</span></label><br>
                       <input type="text" name="g_address[email]" id="g_email" value="{$user.email}" title="Email Address" class="validate-email required-entry input-text">
                   </div>
                   <div class="input-box input-telephone">
                       <label  >Telephone <span class="required">*</span></label><br>
                       <input type="text" name="g_address[mobile]" value="" title="Telephone" class="required-entry input-text" id="g_mobile">
                   </div>
               </li>
               <li class="clearfix">
                   <div class="input-box input-address">
                       <label  >Address<span class="required">*</span></label><br>
                       <input type="text" title="Street Address 1" name="g_address[address]" id="g_address" value="" class="required-entry input-text onestepcheckout-address-line">
                      <!--<br><input type="text" title="Street Address 2" name="billing[street][]" id="billing:street2" value="" class="input-text onestepcheckout-address-line">-->
                   </div>
               </li>
               <li class="clearfix">
                   <div class="input-box input-country">
                       <label  >Country <span class="required">*</span></label><br>
                       <select name="g_address[country]" id="g_country" class="validate-select" title="Country">

                          <option value="0">-- Please Select a country--</option>
                          <option value="Afghanistan">Afghanistan</option>
                          <option value="Åland Islands">Åland Islands</option>
                          <option value="Albania">Albania</option>
                          <option value="Algeria">Algeria</option>
                          <option value="American Samoa">American Samoa</option>
                          <option value="Andorra">Andorra</option>
                          <option value="Angola">Angola</option>
                          <option value="Anguilla">Anguilla</option>
                          <option value="Antarctica">Antarctica</option>
                          <option value="Antigua and Barbuda">Antigua and Barbuda</option>
                          <option value="Argentina">Argentina</option>
                          <option value="Armenia">Armenia</option>
                          <option value="Aruba">Aruba</option>
                          <option value="Australia">Australia</option>
                          <option value="Austria">Austria</option>
                          <option value="Azerbaijan">Azerbaijan</option>
                          <option value="Bahamas">Bahamas</option>
                          <option value="Bahrain">Bahrain</option>
                          <option value="Bangladesh">Bangladesh</option>
                          <option value="Barbados">Barbados</option>
                          <option value="Belarus">Belarus</option>
                          <option value="Belgium">Belgium</option>
                          <option value="Belize">Belize</option>
                          <option value="Benin">Benin</option>
                          <option value="Bermuda">Bermuda</option>
                          <option value="Bhutan">Bhutan</option>
                          <option value="Bolivia">Bolivia</option>
                          <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
                          <option value="Botswana">Botswana</option>
                          <option value="Bouvet Island">Bouvet Island</option>
                          <option value="Brazil">Brazil</option>
                          <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
                          <option value="British Virgin Islands">British Virgin Islands</option>
                          <option value="Brunei">Brunei</option>
                          <option value="Bulgaria">Bulgaria</option>
                          <option value="Burkina Faso">Burkina Faso</option>
                          <option value="Burundi">Burundi</option>
                          <option value="Cambodia">Cambodia</option>
                          <option value="Cameroon">Cameroon</option>
                          <option value="Canada">Canada</option>
                          <option value="Cape Verde">Cape Verde</option>
                          <option value="Cayman Islands">Cayman Islands</option>
                          <option value="Central African Republic">Central African Republic</option>
                          <option value="Chad">Chad</option>
                          <option value="Chile">Chile</option>
                          <option value="China">China</option>
                          <option value="Christmas Island">Christmas Island</option>
                          <option value="Cocos [Keeling] Islands">Cocos [Keeling] Islands</option>
                          <option value="Colombia">Colombia</option>
                          <option value="Comoros">Comoros</option>
                          <option value="Congo - Brazzaville">Congo - Brazzaville</option>
                          <option value="Congo - Kinshasa">Congo - Kinshasa</option>
                          <option value="Cook Islands">Cook Islands</option>
                          <option value="Costa Rica">Costa Rica</option>
                          <option value="Côte d’Ivoire">Côte d’Ivoire</option>
                          <option value="Croatia">Croatia</option>
                          <option value="Cuba">Cuba</option>
                          <option value="Cyprus">Cyprus</option>
                          <option value="Czech Republic">Czech Republic</option>
                          <option value="Denmark">Denmark</option>
                          <option value="Djibouti">Djibouti</option>
                          <option value="Dominica">Dominica</option>
                          <option value="Dominican Republic">Dominican Republic</option>
                          <option value="Ecuador">Ecuador</option>
                          <option value="Egypt">Egypt</option>
                          <option value="El Salvador">El Salvador</option>
                          <option value="Equatorial Guinea">Equatorial Guinea</option>
                          <option value="Eritrea">Eritrea</option>
                          <option value="Estonia">Estonia</option>
                          <option value="Ethiopia">Ethiopia</option>
                          <option value="Falkland Islands">Falkland Islands</option>
                          <option value="Faroe Islands">Faroe Islands</option>
                          <option value="Fiji">Fiji</option>
                          <option value="Finland">Finland</option>
                          <option value="France">France</option>
                          <option value="French Guiana">French Guiana</option>
                          <option value="French Polynesia">French Polynesia</option>
                          <option value="French Southern Territories">French Southern Territories</option>
                          <option value="Gabon">Gabon</option>
                          <option value="Gambia">Gambia</option>
                          <option value="Georgia">Georgia</option>
                          <option value="Germany">Germany</option>
                          <option value="Ghana">Ghana</option>
                          <option value="Gibraltar">Gibraltar</option>
                          <option value="Greece">Greece</option>
                          <option value="Greenland">Greenland</option>
                          <option value="Grenada">Grenada</option>
                          <option value="Guadeloupe">Guadeloupe</option>
                          <option value="Guam">Guam</option>
                          <option value="Guatemala">Guatemala</option>
                          <option value="Guernsey">Guernsey</option>
                          <option value="Guinea">Guinea</option>
                          <option value="Guinea-Bissau">Guinea-Bissau</option>
                          <option value="Guyana">Guyana</option>
                          <option value="Haiti">Haiti</option>
                          <option value="Heard Island and McDonald Islands">Heard Island and McDonald Islands</option>
                          <option value="Honduras">Honduras</option>
                          <option value="Hong Kong SAR China">Hong Kong SAR China</option>
                          <option value="Hungary">Hungary</option>
                          <option value="Iceland">Iceland</option>
                          <option value="India">India</option>
                          <option value="Indonesia">Indonesia</option>
                          <option value="Iran">Iran</option>
                          <option value="Iraq">Iraq</option>
                          <option value="Ireland">Ireland</option>
                          <option value="Isle of Man">Isle of Man</option>
                          <option value="Israel">Israel</option>
                          <option value="Italy">Italy</option>
                          <option value="Jamaica">Jamaica</option>
                          <option value="Japan">Japan</option>
                          <option value="Jersey">Jersey</option>
                          <option value="Jordan">Jordan</option>
                          <option value="Kazakhstan">Kazakhstan</option>
                          <option value="Kenya">Kenya</option>
                          <option value="Kiribati">Kiribati</option>
                          <option value="Kuwait">Kuwait</option>
                          <option value="Kyrgyzstan">Kyrgyzstan</option>
                          <option value="Laos">Laos</option>
                          <option value="Latvia">Latvia</option>
                          <option value="Lebanon">Lebanon</option>
                          <option value="Lesotho">Lesotho</option>
                          <option value="Liberia">Liberia</option>
                          <option value="Libya">Libya</option>
                          <option value="Liechtenstein">Liechtenstein</option>
                          <option value="Lithuania">Lithuania</option>
                          <option value="Luxembourg">Luxembourg</option>
                          <option value="Macau SAR China">Macau SAR China</option>
                          <option value="Macedonia">Macedonia</option>
                          <option value="Madagascar">Madagascar</option>
                          <option value="Malawi">Malawi</option>
                          <option value="Malaysia">Malaysia</option>
                          <option value="Maldives">Maldives</option>
                          <option value="Mali">Mali</option>
                          <option value="Malta">Malta</option>
                          <option value="Marshall Islands">Marshall Islands</option>
                          <option value="Martinique">Martinique</option>
                          <option value="Mauritania">Mauritania</option>
                          <option value="Mauritius">Mauritius</option>
                          <option value="Mayotte">Mayotte</option>
                          <option value="Mexico">Mexico</option>
                          <option value="Micronesia">Micronesia</option>
                          <option value="Moldova">Moldova</option>
                          <option value="Monaco">Monaco</option>
                          <option value="Mongolia">Mongolia</option>
                          <option value="Montenegro">Montenegro</option>
                          <option value="Montserrat">Montserrat</option>
                          <option value="Morocco">Morocco</option>
                          <option value="Mozambique">Mozambique</option>
                          <option value="Myanmar [Burma]">Myanmar [Burma]</option>
                          <option value="Namibia">Namibia</option>
                          <option value="Nauru">Nauru</option>
                          <option value="Nepal">Nepal</option>
                          <option value="Netherlands">Netherlands</option>
                          <option value="Netherlands Antilles">Netherlands Antilles</option>
                          <option value="New Caledonia">New Caledonia</option>
                          <option value="New Zealand">New Zealand</option>
                          <option value="Nicaragua">Nicaragua</option>
                          <option value="Niger">Niger</option>
                          <option value="Nigeria">Nigeria</option>
                          <option value="Niue">Niue</option>
                          <option value="Norfolk Island">Norfolk Island</option>
                          <option value="Northern Mariana Islands">Northern Mariana Islands</option>
                          <option value="North Korea">North Korea</option>
                          <option value="Norway">Norway</option>
                          <option value="Oman">Oman</option>
                          <option value="Pakistan">Pakistan</option>
                          <option value="Palau">Palau</option>
                          <option value="Palestinian Territories">Palestinian Territories</option>
                          <option value="Panama">Panama</option>
                          <option value="Papua New Guinea">Papua New Guinea</option>
                          <option value="Paraguay">Paraguay</option>
                          <option value="Peru">Peru</option>
                          <option value="Philippines">Philippines</option>
                          <option value="Pitcairn Islands">Pitcairn Islands</option>
                          <option value="Poland">Poland</option>
                          <option value="Portugal">Portugal</option>
                          <option value="Puerto Rico">Puerto Rico</option>
                          <option value="Qatar">Qatar</option>
                          <option value="Réunion">Réunion</option>
                          <option value="Romania">Romania</option>
                          <option value="Russia">Russia</option>
                          <option value="Rwanda">Rwanda</option>
                          <option value="Saint Barthélemy">Saint Barthélemy</option>
                          <option value="Saint Helena">Saint Helena</option>
                          <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
                          <option value="Saint Lucia">Saint Lucia</option>
                          <option value="Saint Martin">Saint Martin</option>
                          <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
                          <option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</option>
                          <option value="Samoa">Samoa</option>
                          <option value="San Marino">San Marino</option>
                          <option value="São Tomé and Príncipe">São Tomé and Príncipe</option>
                          <option value="Saudi Arabia">Saudi Arabia</option>
                          <option value="Senegal">Senegal</option>
                          <option value="Serbia">Serbia</option>
                          <option value="Seychelles">Seychelles</option>
                          <option value="Sierra Leone">Sierra Leone</option>
                          <option value="Singapore">Singapore</option>
                          <option value="Slovakia">Slovakia</option>
                          <option value="Slovenia">Slovenia</option>
                          <option value="Solomon Islands">Solomon Islands</option>
                          <option value="Somalia">Somalia</option>
                          <option value="South Africa">South Africa</option>
                          <option value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</option>
                          <option value="South Korea">South Korea</option>
                          <option value="Spain">Spain</option>
                          <option value="Sri Lanka">Sri Lanka</option>
                          <option value="Sudan">Sudan</option>
                          <option value="Suriname">Suriname</option>
                          <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
                          <option value="Swaziland">Swaziland</option>
                          <option value="Sweden">Sweden</option>
                          <option value="Switzerland">Switzerland</option>
                          <option value="Syria">Syria</option>
                          <option value="Taiwan">Taiwan</option>
                          <option value="Tajikistan">Tajikistan</option>
                          <option value="Tanzania">Tanzania</option>
                          <option value="Thailand">Thailand</option>
                          <option value="Timor-Leste">Timor-Leste</option>
                          <option value="Togo">Togo</option>
                          <option value="Tokelau">Tokelau</option>
                          <option value="Tonga">Tonga</option>
                          <option value="Trinidad and Tobago">Trinidad and Tobago</option>
                          <option value="Tunisia">Tunisia</option>
                          <option value="Turkey">Turkey</option>
                          <option value="Turkmenistan">Turkmenistan</option>
                          <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
                          <option value="Tuvalu">Tuvalu</option>
                          <option value="Uganda">Uganda</option>
                          <option value="Ukraine">Ukraine</option>
                          <option value="United Arab Emirates">United Arab Emirates</option>
                          <option value="United Kingdom">United Kingdom</option>
                          <option value="United States">United States</option>
                          <option value="Uruguay">Uruguay</option>
                          <option value="U.S. Minor Outlying Islands">U.S. Minor Outlying Islands</option>
                          <option value="U.S. Virgin Islands">U.S. Virgin Islands</option>
                          <option value="Uzbekistan">Uzbekistan</option>
                          <option value="Vanuatu">Vanuatu</option>
                          <option value="Vatican City">Vatican City</option>
                          <option value="Venezuela">Venezuela</option>
                          <option value="Vietnam">Vietnam</option>
                          <option value="Wallis and Futuna">Wallis and Futuna</option>
                          <option value="Western Sahara">Western Sahara</option>
                          <option value="Yemen">Yemen</option>
                          <option value="Zambia">Zambia</option>
                          <option value="Zimbabwe">Zimbabwe</option>
                       </select>
                   </div>
               </li>

                    <li class="clearfix">
                        <div class="input-box input-city">
                            <label  >State <span class="required">*</span></label><br>
                            <input type="text" name="g_address[state]" value="" title="City" class="required-entry input-text" id="g_state">
                        </div>
                    </li>


               <li class="clearfix">
                   <div class="input-box input-city">
                       <label  >City <span class="required">*</span></label><br>
                       <input type="text" name="g_address[city]" value="" title="City" class="required-entry input-text" id="g_city">
                   </div>
               </li>
               <li class="clearfix">
                   <div class="input-box input-postcode">
                       <label  >Zip Code <span class="required">*</span></label><br>
                       <input type="text" title="Zip Code" name="g_address[zipcode]" id="g_zipcode" value="" class="validate-zip-international required-entry input-text">
                   </div>

               </li>
                     
               <!--<if condition="$_SESSION['user']['user_id'] eq ''">-->
                   <!--<li class="clearfix">-->
                       <!--<div class="input-box">-->
                           <!--<label for="create_account" style="font-weight:normal;">-->
                              <!--<input id="create_account" type="checkbox" name="create_account" value="1" style="vertical-align:middle; margin-right:5px; margin-top:-4px;">-->
                              <!--Create an account for later use-->
                           <!--</label>-->
                       <!--</div>-->
                   <!--</li>-->
               <!--</if>-->
        <script>
			
//			$("#create_account").click(function(){
//				if(this.checked) {
//                    $("#onestepcheckout-li-password").show();
//                }
//                else    {
//                    $("#onestepcheckout-li-password").hide();
//                }
//			});


        function address_cp(){
            if($("#address_2_cp").is(":checked")){
                $('#address_2div1').hide();

            }else{
                $('#address_2div1').show();
            }

        }


        </script>


        <!--<li id="onestepcheckout-li-password" style="display: none;">-->
            <!--<div class="input-box input-password">-->
                <!--<label for="password">Password</label><br>-->
                <!--<input type="password" class="required-entry validate-password input-text" value="" title="Password" id="password" name="password">-->
            <!--</div>-->
            <!--<div class="input-box input-password">-->
                <!--<label for="c_password">Confirm password</label><br>-->
                <!--<input type="password" class="required-entry validate-password input-text" value="" id="c_password" title="Confirm Password" name="c_password">-->
            <!--</div>-->
        <!--</li>-->
        <li class="no-display">
           <!--<input type="hidden" name="save_in_address_book" value="1"></li>               -->
                </ul>
                    </li>

                </ul>
            </div>
        </div>
        <div class="col-md-6">
        	 <div>

             <ul class="checkoutAddr">
                 <li class="address-title">Billing address	</li>
                 <li style=" font-weight:normal;">
                     <label  >
                         <input type="checkbox" name="address_2_cp"  id="address_2_cp" onclick="address_cp()" class="userbilAddr"   id="address_2_cp">
                         Use shipping information</label>
                 </li>
                 <div id="address_2div1">
                 
                  <if condition="($_SESSION['user']['user_id'] neq '') and ($address_list)">
                    <li>
                        <label  style="font-weight:normal;">Select a billing address from your address book or enter a new address.</label>
                        <div class="input-box">
                            <select name="f_address_id" id="f_address_id" class="address-selecttwo" title="" >
                              <volist name="address_list" id="v" >
                                 <option value="{$v.address_id}">{$v.country}{$v.city}{$v.address} {$v.consignee} (mobile{$v.mobile})</option>
                             </volist>
                            <option value="">New Address</option></select>
                        </div>
                    </li>
                    </if>
                    
                     
                     
                     <li id="f_address_list1" <if condition="($_SESSION['user']['user_id'] neq '') and ($address_list)">style="display:none;"</if>>
                         <div id="">
                             <ul>
                                 <li class="clearfix">
                                   <div class="input-box input-firstname">
                                       <label >First Name<span class="required">*</span></label><br>
                                       <input class="required-entry input-text" type="text" name="f_address[consignee]" id="f_consignee" value="{$user.nickname}">
                                   </div>
                                   <div class="input-box input-lastname">
                                       <label  >Last Name <span class="required">*</span></label><br>
                                       <input class="required-entry input-text" type="text" name="f_address[lastname]" id="f_lastname" value="{$user.lastname}">
                                   </div>
                                 </li>
                                     <li class="clearfix">
                                        <div class="input-box input-email">
                                           <label  >Email Address <span class="required">*</span></label><br>
                                           <input type="text" name="f_address[email]" id="f_email" value="{$user.email}" title="Email Address" class="validate-email required-entry input-text">
                                        </div>
                                         <div class="input-box input-telephone">
                                             <label  >Telephone <span class="required">*</span></label><br>
                                             <input type="text" name="f_address[mobile]" value="" title="Telephone" class="required-entry input-text" id="f_mobile">
                                         </div>
                                     </li>
                                     <li class="clearfix">
                                         <div class="input-box input-address">
                                             <label  >Address<span class="required">*</span></label><br>
                                             <input type="text" title="Street Address " name="f_address[address]" id="f_address" value="" class="required-entry input-text onestepcheckout-address-line">
                                            <!--<br><input type="text" title="Street Address 2" name="shipping[street][]" id="shipping:street2" value="测试" class="input-text onestepcheckout-address-line">-->
                                         </div>
                                     </li>
                                     <li class="clearfix">
                                           <div class="input-box input-country">
                                               <label >Country <span class="required">*</span></label><br>
                                                   <select name="f_address[country]" id="f_country" class="validate-select" title="Country"  >
                                                                      <option value="0">-- Please Select a country--</option>
                                                                       <option value="Afghanistan">Afghanistan</option>
                                                                       <option value="Åland Islands">Åland Islands</option>
                                                                       <option value="Albania">Albania</option>
                                                                       <option value="Algeria">Algeria</option>
                                                                       <option value="American Samoa">American Samoa</option>
                                                                       <option value="Andorra">Andorra</option>
                                                                       <option value="Angola">Angola</option>
                                                                       <option value="Anguilla">Anguilla</option>
                                                                       <option value="Antarctica">Antarctica</option>
                                                                       <option value="Antigua and Barbuda">Antigua and Barbuda</option>
                                                                       <option value="Argentina">Argentina</option>
                                                                       <option value="Armenia">Armenia</option>
                                                                       <option value="Aruba">Aruba</option>
                                                                       <option value="Australia">Australia</option>
                                                                       <option value="Austria">Austria</option>
                                                                       <option value="Azerbaijan">Azerbaijan</option>
                                                                       <option value="Bahamas">Bahamas</option>
                                                                       <option value="Bahrain">Bahrain</option>
                                                                       <option value="Bangladesh">Bangladesh</option>
                                                                       <option value="Barbados">Barbados</option>
                                                                       <option value="Belarus">Belarus</option>
                                                                       <option value="Belgium">Belgium</option>
                                                                       <option value="Belize">Belize</option>
                                                                       <option value="Benin">Benin</option>
                                                                       <option value="Bermuda">Bermuda</option>
                                                                       <option value="Bhutan">Bhutan</option>
                                                                       <option value="Bolivia">Bolivia</option>
                                                                       <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
                                                                       <option value="Botswana">Botswana</option>
                                                                       <option value="Bouvet Island">Bouvet Island</option>
                                                                       <option value="Brazil">Brazil</option>
                                                                       <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
                                                                       <option value="British Virgin Islands">British Virgin Islands</option>
                                                                       <option value="Brunei">Brunei</option>
                                                                       <option value="Bulgaria">Bulgaria</option>
                                                                       <option value="Burkina Faso">Burkina Faso</option>
                                                                       <option value="Burundi">Burundi</option>
                                                                       <option value="Cambodia">Cambodia</option>
                                                                       <option value="Cameroon">Cameroon</option>
                                                                       <option value="Canada">Canada</option>
                                                                       <option value="Cape Verde">Cape Verde</option>
                                                                       <option value="Cayman Islands">Cayman Islands</option>
                                                                       <option value="Central African Republic">Central African Republic</option>
                                                                       <option value="Chad">Chad</option>
                                                                       <option value="Chile">Chile</option>
                                                                       <option value="China">China</option>
                                                                       <option value="Christmas Island">Christmas Island</option>
                                                                       <option value="Cocos [Keeling] Islands">Cocos [Keeling] Islands</option>
                                                                       <option value="Colombia">Colombia</option>
                                                                       <option value="Comoros">Comoros</option>
                                                                       <option value="Congo - Brazzaville">Congo - Brazzaville</option>
                                                                       <option value="Congo - Kinshasa">Congo - Kinshasa</option>
                                                                       <option value="Cook Islands">Cook Islands</option>
                                                                       <option value="Costa Rica">Costa Rica</option>
                                                                       <option value="Côte d’Ivoire">Côte d’Ivoire</option>
                                                                       <option value="Croatia">Croatia</option>
                                                                       <option value="Cuba">Cuba</option>
                                                                       <option value="Cyprus">Cyprus</option>
                                                                       <option value="Czech Republic">Czech Republic</option>
                                                                       <option value="Denmark">Denmark</option>
                                                                       <option value="Djibouti">Djibouti</option>
                                                                       <option value="Dominica">Dominica</option>
                                                                       <option value="Dominican Republic">Dominican Republic</option>
                                                                       <option value="Ecuador">Ecuador</option>
                                                                       <option value="Egypt">Egypt</option>
                                                                       <option value="El Salvador">El Salvador</option>
                                                                       <option value="Equatorial Guinea">Equatorial Guinea</option>
                                                                       <option value="Eritrea">Eritrea</option>
                                                                       <option value="Estonia">Estonia</option>
                                                                       <option value="Ethiopia">Ethiopia</option>
                                                                       <option value="Falkland Islands">Falkland Islands</option>
                                                                       <option value="Faroe Islands">Faroe Islands</option>
                                                                       <option value="Fiji">Fiji</option>
                                                                       <option value="Finland">Finland</option>
                                                                       <option value="France">France</option>
                                                                       <option value="French Guiana">French Guiana</option>
                                                                       <option value="French Polynesia">French Polynesia</option>
                                                                       <option value="French Southern Territories">French Southern Territories</option>
                                                                       <option value="Gabon">Gabon</option>
                                                                       <option value="Gambia">Gambia</option>
                                                                       <option value="Georgia">Georgia</option>
                                                                       <option value="Germany">Germany</option>
                                                                       <option value="Ghana">Ghana</option>
                                                                       <option value="Gibraltar">Gibraltar</option>
                                                                       <option value="Greece">Greece</option>
                                                                       <option value="Greenland">Greenland</option>
                                                                       <option value="Grenada">Grenada</option>
                                                                       <option value="Guadeloupe">Guadeloupe</option>
                                                                       <option value="Guam">Guam</option>
                                                                       <option value="Guatemala">Guatemala</option>
                                                                       <option value="Guernsey">Guernsey</option>
                                                                       <option value="Guinea">Guinea</option>
                                                                       <option value="Guinea-Bissau">Guinea-Bissau</option>
                                                                       <option value="Guyana">Guyana</option>
                                                                       <option value="Haiti">Haiti</option>
                                                                       <option value="Heard Island and McDonald Islands">Heard Island and McDonald Islands</option>
                                                                       <option value="Honduras">Honduras</option>
                                                                       <option value="Hong Kong SAR China">Hong Kong SAR China</option>
                                                                       <option value="Hungary">Hungary</option>
                                                                       <option value="Iceland">Iceland</option>
                                                                       <option value="India">India</option>
                                                                       <option value="Indonesia">Indonesia</option>
                                                                       <option value="Iran">Iran</option>
                                                                       <option value="Iraq">Iraq</option>
                                                                       <option value="Ireland">Ireland</option>
                                                                       <option value="Isle of Man">Isle of Man</option>
                                                                       <option value="Israel">Israel</option>
                                                                       <option value="Italy">Italy</option>
                                                                       <option value="Jamaica">Jamaica</option>
                                                                       <option value="Japan">Japan</option>
                                                                       <option value="Jersey">Jersey</option>
                                                                       <option value="Jordan">Jordan</option>
                                                                       <option value="Kazakhstan">Kazakhstan</option>
                                                                       <option value="Kenya">Kenya</option>
                                                                       <option value="Kiribati">Kiribati</option>
                                                                       <option value="Kuwait">Kuwait</option>
                                                                       <option value="Kyrgyzstan">Kyrgyzstan</option>
                                                                       <option value="Laos">Laos</option>
                                                                       <option value="Latvia">Latvia</option>
                                                                       <option value="Lebanon">Lebanon</option>
                                                                       <option value="Lesotho">Lesotho</option>
                                                                       <option value="Liberia">Liberia</option>
                                                                       <option value="Libya">Libya</option>
                                                                       <option value="Liechtenstein">Liechtenstein</option>
                                                                       <option value="Lithuania">Lithuania</option>
                                                                       <option value="Luxembourg">Luxembourg</option>
                                                                       <option value="Macau SAR China">Macau SAR China</option>
                                                                       <option value="Macedonia">Macedonia</option>
                                                                       <option value="Madagascar">Madagascar</option>
                                                                       <option value="Malawi">Malawi</option>
                                                                       <option value="Malaysia">Malaysia</option>
                                                                       <option value="Maldives">Maldives</option>
                                                                       <option value="Mali">Mali</option>
                                                                       <option value="Malta">Malta</option>
                                                                       <option value="Marshall Islands">Marshall Islands</option>
                                                                       <option value="Martinique">Martinique</option>
                                                                       <option value="Mauritania">Mauritania</option>
                                                                       <option value="Mauritius">Mauritius</option>
                                                                       <option value="Mayotte">Mayotte</option>
                                                                       <option value="Mexico">Mexico</option>
                                                                       <option value="Micronesia">Micronesia</option>
                                                                       <option value="Moldova">Moldova</option>
                                                                       <option value="Monaco">Monaco</option>
                                                                       <option value="Mongolia">Mongolia</option>
                                                                       <option value="Montenegro">Montenegro</option>
                                                                       <option value="Montserrat">Montserrat</option>
                                                                       <option value="Morocco">Morocco</option>
                                                                       <option value="Mozambique">Mozambique</option>
                                                                       <option value="Myanmar [Burma]">Myanmar [Burma]</option>
                                                                       <option value="Namibia">Namibia</option>
                                                                       <option value="Nauru">Nauru</option>
                                                                       <option value="Nepal">Nepal</option>
                                                                       <option value="Netherlands">Netherlands</option>
                                                                       <option value="Netherlands Antilles">Netherlands Antilles</option>
                                                                       <option value="New Caledonia">New Caledonia</option>
                                                                       <option value="New Zealand">New Zealand</option>
                                                                       <option value="Nicaragua">Nicaragua</option>
                                                                       <option value="Niger">Niger</option>
                                                                       <option value="Nigeria">Nigeria</option>
                                                                       <option value="Niue">Niue</option>
                                                                       <option value="Norfolk Island">Norfolk Island</option>
                                                                       <option value="Northern Mariana Islands">Northern Mariana Islands</option>
                                                                       <option value="North Korea">North Korea</option>
                                                                       <option value="Norway">Norway</option>
                                                                       <option value="Oman">Oman</option>
                                                                       <option value="Pakistan">Pakistan</option>
                                                                       <option value="Palau">Palau</option>
                                                                       <option value="Palestinian Territories">Palestinian Territories</option>
                                                                       <option value="Panama">Panama</option>
                                                                       <option value="Papua New Guinea">Papua New Guinea</option>
                                                                       <option value="Paraguay">Paraguay</option>
                                                                       <option value="Peru">Peru</option>
                                                                       <option value="Philippines">Philippines</option>
                                                                       <option value="Pitcairn Islands">Pitcairn Islands</option>
                                                                       <option value="Poland">Poland</option>
                                                                       <option value="Portugal">Portugal</option>
                                                                       <option value="Puerto Rico">Puerto Rico</option>
                                                                       <option value="Qatar">Qatar</option>
                                                                       <option value="Réunion">Réunion</option>
                                                                       <option value="Romania">Romania</option>
                                                                       <option value="Russia">Russia</option>
                                                                       <option value="Rwanda">Rwanda</option>
                                                                       <option value="Saint Barthélemy">Saint Barthélemy</option>
                                                                       <option value="Saint Helena">Saint Helena</option>
                                                                       <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
                                                                       <option value="Saint Lucia">Saint Lucia</option>
                                                                       <option value="Saint Martin">Saint Martin</option>
                                                                       <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
                                                                       <option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</option>
                                                                       <option value="Samoa">Samoa</option>
                                                                       <option value="San Marino">San Marino</option>
                                                                       <option value="São Tomé and Príncipe">São Tomé and Príncipe</option>
                                                                       <option value="Saudi Arabia">Saudi Arabia</option>
                                                                       <option value="Senegal">Senegal</option>
                                                                       <option value="Serbia">Serbia</option>
                                                                       <option value="Seychelles">Seychelles</option>
                                                                       <option value="Sierra Leone">Sierra Leone</option>
                                                                       <option value="Singapore">Singapore</option>
                                                                       <option value="Slovakia">Slovakia</option>
                                                                       <option value="Slovenia">Slovenia</option>
                                                                       <option value="Solomon Islands">Solomon Islands</option>
                                                                       <option value="Somalia">Somalia</option>
                                                                       <option value="South Africa">South Africa</option>
                                                                       <option value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</option>
                                                                       <option value="South Korea">South Korea</option>
                                                                       <option value="Spain">Spain</option>
                                                                       <option value="Sri Lanka">Sri Lanka</option>
                                                                       <option value="Sudan">Sudan</option>
                                                                       <option value="Suriname">Suriname</option>
                                                                       <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
                                                                       <option value="Swaziland">Swaziland</option>
                                                                       <option value="Sweden">Sweden</option>
                                                                       <option value="Switzerland">Switzerland</option>
                                                                       <option value="Syria">Syria</option>
                                                                       <option value="Taiwan">Taiwan</option>
                                                                       <option value="Tajikistan">Tajikistan</option>
                                                                       <option value="Tanzania">Tanzania</option>
                                                                       <option value="Thailand">Thailand</option>
                                                                       <option value="Timor-Leste">Timor-Leste</option>
                                                                       <option value="Togo">Togo</option>
                                                                       <option value="Tokelau">Tokelau</option>
                                                                       <option value="Tonga">Tonga</option>
                                                                       <option value="Trinidad and Tobago">Trinidad and Tobago</option>
                                                                       <option value="Tunisia">Tunisia</option>
                                                                       <option value="Turkey">Turkey</option>
                                                                       <option value="Turkmenistan">Turkmenistan</option>
                                                                       <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
                                                                       <option value="Tuvalu">Tuvalu</option>
                                                                       <option value="Uganda">Uganda</option>
                                                                       <option value="Ukraine">Ukraine</option>
                                                                       <option value="United Arab Emirates">United Arab Emirates</option>
                                                                       <option value="United Kingdom">United Kingdom</option>
                                                                       <option value="United States">United States</option>
                                                                       <option value="Uruguay">Uruguay</option>
                                                                       <option value="U.S. Minor Outlying Islands">U.S. Minor Outlying Islands</option>
                                                                       <option value="U.S. Virgin Islands">U.S. Virgin Islands</option>
                                                                       <option value="Uzbekistan">Uzbekistan</option>
                                                                       <option value="Vanuatu">Vanuatu</option>
                                                                       <option value="Vatican City">Vatican City</option>
                                                                       <option value="Venezuela">Venezuela</option>
                                                                       <option value="Vietnam">Vietnam</option>
                                                                       <option value="Wallis and Futuna">Wallis and Futuna</option>
                                                                       <option value="Western Sahara">Western Sahara</option>
                                                                       <option value="Yemen">Yemen</option>
                                                                       <option value="Zambia">Zambia</option>
                                                                       <option value="Zimbabwe">Zimbabwe</option></select>
                                           </div>
                                     </li>

                                 <li class="clearfix">
                                     <div class="input-box input-city">
                                         <label  >State <span class="required">*</span></label><br>
                                         <input type="text" name="f_address[state]" value="" title="City" class="required-entry input-text" id="f_state">
                                     </div>
                                 </li>


                                     <li class="clearfix">
                                         <div class="input-box input-city">
                                             <label  >City <span class="required">*</span></label><br>
                                             <input type="text" name="f_address[city]" value="" title="City" class="required-entry input-text" id="f_city">
                                         </div>
                                     </li>
                                     <li class="clearfix">
                                         <div class="input-box input-postcode">
                                             <label  >Zip Code <span class="required">*</span></label><br>
                                             <input type="text" title="Zip Code" name="f_address[zipcode]" id="f_zipcode" value="" class="validate-zip-international required-entry input-text">
                                         </div>
                                    </li>

                             </ul>
                                <!-- END LIST OF SHIPPIING FIELDS -->
                            </div>
                           
                        </li>
                 </div>
             </ul>


           </div>


 </div>

</div>
<div style="display:none;">
<!-- 快递 -->
<!--<foreach name="shippingList" item="v"  key="k"><input id="{$v.code}" type="radio" name="shipping_code" value="{$v.code}" onClick="ajax_order_price();" <if condition="$k eq 0"> checked="checked" </if> /></foreach>-->
</div>


<div class="clear"></div>

<div class="container" style="padding-bottom:100px;">
		<div class="col-md-6">
			<div class="checkoutLeft">
				<h3>SUMMARY</h3>
                <div id="shopping-cart-totals-table">

                <if condition="$promname">
                    <div>
                        <b class="cart_tag">{$Think.lang.preferences} </b>
                        <span class="content_tag">({$promname})
                            <if condition="$total_price.yh_total neq 0">{$Think.lang.active_goods_isfull}{$total_price.selnum}{$Think.lang.jian}（<em>{$Think.lang.has_been_reduced}¥{$total_price.yh_total}</em>)</if></span>
                        <if condition="$total_price.yh_total neq 0"> <div class="right_price" style="margin-right: 35px;">¥ {$total_price.total_header_fee}<br ><em>{$Think.lang.jian1}：¥ {$total_price.yh_total}</em></div></if>
                    </div>
                </if>


         <foreach name="cartList" item="v"  key="k">
                    <if condition="$v[selected] eq '1'">
                        <div class="orderBox clearfix">
                            <div class="col-md-4 col-xs-6"><img border="0" alt="{$bi,$v[goods_id]|goods_name_shift}" src="{$v.goods_id|goods_thum_images=136,136}" style="border:1px solid #dedede;"></div>
                            <div class="col-md-5 col-xs-12"><a href="{:U('Home/Goods/goodsInfo',array('id'=>$v[goods_id]))}">{$bi,$v[goods_id]|goods_name_shift}</a>
                                   <!--{$v.attach|get_attach_show}-->
                            </div>
                            <div class="col-sm-1 col-xs-6">{$v.goods_num}</div>
                            <div class="col-sm-2 col-xs-6"><span class="price">{$total_price.money_str}{$v.goods_fee}</span></div>
                        </div>
                     </if>
            </foreach>


<table style="width:100%">
<tbody>

 <if condition="$couponList" >
    <tr>
        <td class="title" style="text-align:right">Coupon list</td>
        <td class="value" style="text-align:right"><input type="radio" class="radio vam ma-ri-10" name="couponTypeSelect" checked value="1"  onClick="ajax_order_price();" style="display: none;" />
         <select id="coupon_id" name="coupon_id" class="vam ou-no" onChange="ajax_order_price();">
             <option value="0"></option>
              <foreach name="couponList" item="v"  key="k">
                <option value="{$v['id']}">{$v['name']}</option>
              </foreach>
         </select>
        </td>
    </tr>
    </if>

   	<tr>
        <td class="title" style="text-align:right">Subtotal</td>
        <td class="value" style="text-align:right"><span class="price" id="order-cost-area">{$total_price.money_str}{$total_price.total_header_fee}</span></td>
    </tr>
   	<tr>
        <td class="title" style="text-align:right">Shipping costs</td>
        <td class="value" style="text-align:right"><span class="price" id="postFee"></span></td>
    </tr>


    <if condition="$userstate" >
   	<tr>
        <td class="title" style="text-align:right">Coupon</td>
        <td class="value" style="text-align:right"><span class="price" id="couponFee"></span></td>
    </tr>
     </if>
   	<tr>
        <td class="title" style="text-align:right">Promotions</td>
        <td class="value" style="text-align:right"><span class="price" id="order_prom_amount"></span></td>
    </tr>


    <tr class="grand-total">
        <td class="title" style="text-align:right">Grand total</td>
        <td class="value" style="text-align:right"><span class="price" id="payables"></span></td>
    </tr>
    </tbody></table>



<style>
td.title{width:70%}
</style>
</div>
			</div>
		</div>
		<div class="col-md-6 ">
			<div class="checkoutRihgt">
				<h3>SUBMIT</h3>
				<div>
                <div style="display:none;">

                                  <!--<input name="shipping_method" type="hidden" value="flatrate_flatrate" id="s_method_flatrate_flatrate" checked="checked">-->
                </div>





                        <div class="payment-methods">


                                <dl id="checkout-payment-method-load" style="display:none;">

                                     <dt >
                                        <input id="p_method_paypal_standard" value="paypal_standard" type="radio" name="payment[method]" title="Paypal and Credit card" class="radio validate-one-required-by-name" checked="checked">
                                        <label for="p_method_paypal_standard">Paypal and Credit card</label>
                                    </dt>
                                    <dd id="container_payment_method_paypal_standard" class="payment-method">
                                        <ul class="form-list" id="payment_form_paypal_standard" style="display:none;">
                                            <li class="form-alt"><br><img src="http://www.chinachandelier.com/skin/frontend/base/default/images/paypalico.jpg"><br><br>Existing PayPal users can complete your payment using your PayPal account.
                                                         Sign in as a PayPal guest and pay with your credit card.</li>
                                        </ul>
                                    </dd>
                                </dl>
                            </div>

                    <div class="tool-tip" id="payment-tool-tip" style="display:none;">
                        <div class="btn-close">
                            <a href="#" id="payment-tool-tip-close"><img src="http://www.chinachandelier.com/skin/frontend/default/default/images/btn_window_close.gif" alt="Close"></a>
                        </div>
                        <div class="block-content">
                        <img src="http://www.chinachandelier.com/skin/frontend/default/default/images/cvv.gif" alt="Card Verification Number Visual Reference">
                        </div>
                    </div>

                <style>
				.radio{display:inline;}
				ul{padding:0}
				</style>
					<br>
					<p>Ready yo place your order?</p>
					<p><input type="button" class="orderSubPay" value="CONTINUE TO SUBMIT" id="onestepcheckout-place-order" onClick="submit_order();"></p>
                 </div>
		</div>
	</div>
    <input name="hd_id" id="hd_id" value="{$hd_id}" type="hidden"/>

</div>

</form>

<link rel="stylesheet" href="__STATIC__/css/cart.css" type="text/css">

<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->
<script>
$(document).ready(function(){
	ajax_address(); // 获取用户收货地址列表
	
	$('.address-select').change(function(){
　　　　　　var thisval = $(this).children('option:selected').val();
		if(!thisval)
		{
			$("#billing_address_list").css("display","block");
		}
		else
		{
			$("#billing_address_list").css("display","none");
		}
		
　　　　});

	$('.address-selecttwo').change(function(){
　　　　　　var thisval = $(this).children('option:selected').val();
		if(!thisval)
		{
			$("#f_address_list1").css("display","block");
		}
		else
		{
			$("#f_address_list1").css("display","none");
		}
		
　　　　});
	//ajax_order_price();
});
/**
* 新增修改收货地址
* id 为零 则为新增, 否则是修改
*  使用 公共的 layer 弹窗插件  参考官方手册 http://layer.layui.com/
*/
// 添加修改收货地址回调函数
function call_back_fun(v){
	layer.closeAll(); // 关闭窗口
	ajax_address(); // 刷新收货地址
}

/*
* ajax 获取当前用户的收货地址列表
*/
function ajax_address(){
	$.ajax({
		url:"{:U('Home/Cart/ajaxAddress')}",//+tab,
		success: function(data){
//		    alert(data);return;
			$("#ajax_address").html('');
			$("#ajax_address").append(data);

		}
	});
	ajax_order_price();

}



// 切换收货地址
function swidth_address(obj)
{
    var province_id = $(obj).attr('data-province-id');
    var city_id = $(obj).attr('data-city-id');
    var district_id = $(obj).attr('data-district-id');
    if (typeof($(obj).attr('data-province-id')) != 'undefined') {
        ajax_pickup(province_id,city_id,district_id,0);
    }
    $(".order-address-list").removeClass('address_current');
    $(obj).parent().parent().parent().parent().parent().addClass('address_current');
    if($('#address_id').length > 0)
        ajax_order_price(); // 计算订单价格
}

/**
 * 获取用户自提点和推荐自提点
 * @param type 1：用户自提点 ，0：用户自提点和推荐自提点
 * @param province_id 省
 * @param city_id 市
 * @param district_id 区
 */
function ajax_pickup(province_id, city_id, district_id,show) {
    $.ajax({
        type: 'GET',
        url: "{:U('Home/Cart/ajaxPickup')}",//+tab,
        data: {province_id: province_id, city_id: city_id, district_id: district_id,show:show},
        success: function (data) {
            $("#ajax_pickup").html('');
            $("#ajax_pickup").append(data);
        }
    });
}
//更换自提点
function replace_pickup(province_id, city_id, district_id) {
    var url = "/index.php?m=Home&c=Cart&a=replace_pickup&call_back=call_back_pickup&province_id="+province_id+"&city_id="+city_id+"&district_id="+district_id;
    layer.open({
        type: 2,
        title: '{$Think.lang.addaddress_1} ',
        shadeClose: true,
        shade: 0.8,
        area: ['880px', '580px'],
        content: url,
    });
}
// 添加自提点地址回调函数
function call_back_pickup(province_id,city_id,district_id){
    layer.closeAll(); // 关闭窗口
    ajax_pickup(province_id, city_id, district_id,1);
}


// 获取订单价格
function ajax_order_price()
{
//	alert($('#cart2_form').serialize());
	$.ajax({
		type : "POST",
		url:"{:U('Home/Cart/cart3')}",//+tab,
		data : $('#cart2_form').serialize()+"&act=order_price&nosubmit=1",// 你的formid
        dataType: "json",
		success: function(data){

			if(data.status != 1)
			{
				// alert(data.msg); //执行有误

				layer.alert(data.msg, {icon: 1});


				// 登录超时
				if(data.status == -100)
					location.href ="{:U('Home/User/login')}";

				return false;
			}
			 console.log(data);
			//$("#couponFee, #pointsFee, #order_prom_amount").css('display','none');
			$("#order-cost-area").text(data.result.money_str+data.result.goodsFee);
			$("#postFee").text(data.result.money_str+data.result.postFee); // 物流费
			$("#couponFee").text(data.result.money_str+data.result.couponFee);// 优惠券
//			$("#balance").text(data.result.money_str+data.result.balance);// 余额
//			$("#pointsFee").text(data.result.pointsFee);// 积分支付
			$("#payables").text(data.result.money_str+data.result.payables);// 应付
			$("#order_prom_amount").text(data.result.money_str+data.result.order_prom_amount);// 订单 优惠活动
		}
	});
}

// 提交订单
ajax_return_status = 1;
function submit_order()
{
    var g_address_id =$('#g_address_id').val();
    var g_consignee =$('#g_consignee').val();
    var g_lastname =$('#g_lastname').val();
    var g_email =$('#g_email').val();
    var g_mobile =$('#g_mobile').val();
    var g_address =$('#g_address').val();
    var g_country =$('#g_country').val();
    var g_city =$('#g_city').val();
    var g_state =$('#g_state').val();
    var g_zipcode =$('#g_zipcode').val();
    var create_account =$("#create_account").is(":checked");
    var password =$('#password').val();
    var c_password =$('#c_password').val();

   if(!g_address_id){
      if(!g_consignee){layer.msg('please enter First Name',{icon: 1,time: 2000});return;}
      if(!g_lastname){layer.msg('please enter Last Name',{icon: 1,time: 2000});return;}
      if(!g_email){layer.msg('please enter Email',{icon: 1,time: 2000});return;}
      if(!g_mobile){layer.msg('please enter Telephone',{icon:1,time: 2000});return;}
      if(!g_address){layer.msg('please enter Address',{icon: 1,time: 2000});return;}
      if(g_country==0){layer.msg('please select Country',{icon: 1,time: 2000});return;}
      if(!g_city){layer.msg('please enter City',{icon: 1,time: 2000});return;}
       if(!g_state){layer.msg('please enter State',{icon: 1,time: 2000});return;}
      if(!g_zipcode){layer.msg('please enter Zip Code',{icon: 1,time: 2000});return;}
   }
   /*
   if(create_account){
       if(!password){layer.msg('please enter password',{icon: 1,time: 2000});return;}
       if(!c_password){layer.msg('please enter Confirm password',{icon: 1,time: 2000});return;}
       if(c_password!=password){layer.msg('Entered passwords differ ,please enter again',{icon: 1,time: 2000});return;}
   }*/

    var address_2_cp =$("#address_2_cp").is(":checked");
    var f_address_id =$('#f_address_id').val();
    var f_consignee =$('#f_consignee').val();
    var f_lastname =$('#f_lastname').val();
    var f_email =$('#f_email').val();
    var f_mobile =$('#f_mobile').val();
    var f_address =$('#f_address').val();
    var f_country =$('#f_country').val();
    var f_city =$('#f_city').val();
    var f_state =$('#f_state').val();
    var f_zipcode =$('#f_zipcode').val();



    if(!address_2_cp){
        if(!f_address_id){
            if(!f_consignee){layer.msg('please enter Billing First Name',{icon: 1,time: 2000});return;}
            if(!f_consignee){layer.msg('please enter Billing First Name',{icon: 1,time: 2000});return;}
            if(!f_lastname){layer.msg('please enter Billing Last Name',{icon: 1,time: 2000});return;}
            if(!f_email){layer.msg('please enter Billing Email',{icon: 1,time: 2000});return;}
            if(!f_mobile){layer.msg('please enter Billing Telephone',{icon: 1,time: 2000});return;}
            if(!f_address){layer.msg('please enter Billing Address',{icon: 1,time: 2000});return;}
            if(f_country==0){layer.msg('please select Billing Country',{icon: 1,time: 2000});return;}
            if(!f_city){layer.msg('please enter Billing City',{icon: 1,time: 2000});return;}
            if(!f_state){layer.msg('please enter Billing State',{icon: 1,time: 2000});return;}
            if(!f_zipcode){layer.msg('please enter Billing Zip Code',{icon: 1,time: 2000});return;}
        }

    }

	if(ajax_return_status == 0)


	ajax_return_status = 0;

	$.ajax({
		type : "POST",
		url:"{:U('Home/Cart/cart3')}",//+tab,
		data : $('#cart2_form').serialize()+"&act=submit_order",// 你的formid
        dataType: "json",
		success: function(data){


			if(data.status != '1')
			{
				// alert(data.msg); //执行有误

				if(data.status=="-3")
				{
						//add_edit_address(0);
				}
				else
				{
						layer.alert(data.msg, {icon: 1});
				}
				// 登录超时
				if(data.status == -100)
					location.href ="{:U('Home/User/login')}";

				ajax_return_status = 1; // 上一次ajax 已经返回, 可以进行下一次 ajax请求

				return false;
			}
			//alert();
			// console.log(data);
//			$("#postFee").text(data.result.postFee); // 物流费
//			$("#couponFee").text(data.result.couponFee);// 优惠券
//			$("#balance").text(data.result.balance);// 余额
//			$("#pointsFee").text(data.result.pointsFee);// 积分支付
//			$("#payables").text(data.result.payables);// 应付
//			$("#order_prom_amount").text(data.result.order_prom_amount);// 订单 优惠活动

			layer.msg('{$Think.lang.order_success_hints}', {
			  icon: 1,   // 成功图标
			  time: 2000 //2秒关闭（如果不配置，默认是3秒）
			}, function(){ // 关闭后执行的函数
					location.href = "/index.php?m=Home&c=Cart&a=cart4&order_id="+data.result; // 跳转到结算页
			});
		}
	});
}
</script>
</body>
</html>
